/**
	* Copyright (c) minuteproject, minuteproject@gmail.com
	* All rights reserved.
	* 
	* Licensed under the Apache License, Version 2.0 (the "License")
	* you may not use this file except in compliance with the License.
	* You may obtain a copy of the License at
	* 
	* http://www.apache.org/licenses/LICENSE-2.0
	* 
	* Unless required by applicable law or agreed to in writing, software
	* distributed under the License is distributed on an "AS IS" BASIS,
	* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	* See the License for the specific language governing permissions and
	* limitations under the License.
	* 
	* More information on minuteproject:
	* twitter @minuteproject
	* wiki http://minuteproject.wikispaces.com 
	* blog http://minuteproject.blogspot.net
	* 
*/
/**
	* template reference : 
	* - name : OpenxavaDomainObjectUML
	* - file name : DomainObjectUMLJPAAnnotationOXAnnotationV4.vm
*/
package sistema_oficial.sistema_oficial.domain.sistemaoficial;

//MP-MANAGED-ADDED-AREA-BEGINNING @import@
//MP-MANAGED-ADDED-AREA-ENDING @import@
import java.sql.*;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;

import javax.persistence.*;
import org.openxava.annotations.*;

import sistema_oficial.sistema_oficial.domain.sistemaoficial.BalanceSaldo;
import sistema_oficial.sistema_oficial.domain.sistemaoficial.CuentaMayor;

/**
 *
 * <p>Title: DetalleBalance</p>
 *
 * <p>Description: Domain Object describing a DetalleBalance entity</p>
 *
 */
@Entity (name="DetalleBalance")
@Table (name="detalle_balance")
@Views({
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @view-base-detalle_balance@
	@View(
		name="base",
		members=
        "" 	
        + "numero  ; "
        + "cuentaMayorCodigo  ; "
        + "saldoDebe  ; "
        + "saldoHaber  ; "
        + "balanceSaldoIdentificador  ; "
		),
//MP-MANAGED-UPDATABLE-ENDING
	@View(
		name="Create", 
		extendsView="base"
	),
	@View(
		name="Update", 
		extendsView="base",
        members=
          "" 	
	),
	@View(extendsView="base",
        members=
          "" 	
	),
    @View(name="detalleBalanceDEFAULT_VIEW", 
	   members=
          " numero ;" 	
        + "saldoDebe  ; "
        + "saldoHaber  ; "
	),
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @view-reference-detalle_balance@
    @View(name="reference", 
       extendsView="detalleBalanceDEFAULT_VIEW"
//MP-MANAGED-UPDATABLE-ENDING
    )
})

@Tabs({
@Tab(
properties=
     " saldoDebe "
    +",  saldoHaber "
)
,
@Tab(
name = "DetalleBalanceTab",
properties=
     " saldoDebe "
    +",  saldoHaber "
)
,
@Tab(
name = "DetalleBalanceTabWithRef",
properties=
     " saldoDebe "
    +",  saldoHaber "
)
})
//MP-MANAGED-ADDED-AREA-BEGINNING @class-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @class-annotation@
public class DetalleBalance {

    @Hidden @Id @Column(name="numero" )
    private Integer numero; 

//MP-MANAGED-ADDED-AREA-BEGINNING @saldo_debe-field-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @saldo_debe-field-annotation@

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @ATTRIBUTE-saldo_debe@
    @Column(name="saldo_debe",   nullable=false,  unique=false)
    @Required
    private java.math.BigDecimal saldoDebe;	
//MP-MANAGED-UPDATABLE-ENDING

//MP-MANAGED-ADDED-AREA-BEGINNING @saldo_haber-field-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @saldo_haber-field-annotation@

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @ATTRIBUTE-saldo_haber@
    @Column(name="saldo_haber",   nullable=false,  unique=false)
    @Required
    private java.math.BigDecimal saldoHaber;	
//MP-MANAGED-UPDATABLE-ENDING


//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @parent-BalanceSaldo-detalle_balance@
    @ManyToOne (fetch=FetchType.LAZY ,optional=false) //remove optional=false to aggragate but leads to a side effect when going directly to the entity: required check is not performed=> if no set DB check constraint is raised...
    @JoinColumn(name="balance_saldo_identificador", nullable=false,  unique=false  )
    @ReferenceView ("reference") 
    private BalanceSaldo balanceSaldoIdentificador; 
    
//MP-MANAGED-UPDATABLE-ENDING
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @parent-CuentaMayor-detalle_balance@
    @ManyToOne (fetch=FetchType.LAZY ,optional=false) //remove optional=false to aggragate but leads to a side effect when going directly to the entity: required check is not performed=> if no set DB check constraint is raised...
    @JoinColumn(name="cuenta_mayor_codigo", nullable=false,  unique=false  )
    @ReferenceView ("reference") 
    private CuentaMayor cuentaMayorCodigo; 
    
//MP-MANAGED-UPDATABLE-ENDING
//children
//m2m
    /**
    * Default constructor
    */
    public DetalleBalance() {
    }


    public Integer getNumero() {
        return numero;
    }
	
    public void setNumero (Integer numero) {
        this.numero =  numero;
    }
    

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @GETTER-SETTER-saldo_debe@
    public java.math.BigDecimal getSaldoDebe() {
        return saldoDebe;
    }
	
    public void setSaldoDebe (java.math.BigDecimal saldoDebe) {
        this.saldoDebe =  saldoDebe;
    } 
//MP-MANAGED-UPDATABLE-ENDING

//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @GETTER-SETTER-saldo_haber@
    public java.math.BigDecimal getSaldoHaber() {
        return saldoHaber;
    }
	
    public void setSaldoHaber (java.math.BigDecimal saldoHaber) {
        this.saldoHaber =  saldoHaber;
    } 
//MP-MANAGED-UPDATABLE-ENDING


    public BalanceSaldo getBalanceSaldoIdentificador () {  //
    	return balanceSaldoIdentificador;
    }
	
    public void setBalanceSaldoIdentificador (BalanceSaldo balanceSaldoIdentificador) {
    	this.balanceSaldoIdentificador = balanceSaldoIdentificador;//this.balanceSaldoIdentificador = balanceSaldo;
    }
    public CuentaMayor getCuentaMayorCodigo () {  //
    	return cuentaMayorCodigo;
    }
	
    public void setCuentaMayorCodigo (CuentaMayor cuentaMayorCodigo) {
    	this.cuentaMayorCodigo = cuentaMayorCodigo;//this.cuentaMayorCodigo = cuentaMayor;
    }




//MP-MANAGED-ADDED-AREA-BEGINNING @implementation@
//MP-MANAGED-ADDED-AREA-ENDING @implementation@

}
